﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KQExport.aspx.cs" Inherits="RenShiKaoQin.Account.KQExport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true">
    </ajaxToolkit:ToolkitScriptManager>
    <asp:HiddenField ID="hfDeptCode" runat="server" />
    <div style="margin-top:80px" align="center">
    选择导出时间段：从<asp:TextBox
        ID="tbStart" runat="server" Width="120px" EnableViewState="False" 
        ViewStateMode="Disabled"></asp:TextBox><ajaxToolkit:CalendarExtender ID="caltbStart"
            TargetControlID="tbStart" runat="server" Format="yyyy-MM-dd" DefaultView="Months">
        </ajaxToolkit:CalendarExtender>
    至<asp:TextBox ID="tbEnd" runat="server" Width="120px" EnableViewState="False" 
        ViewStateMode="Disabled"></asp:TextBox><ajaxToolkit:CalendarExtender
        ID="CalendarExtender1" TargetControlID="tbEnd" runat="server" Format="yyyy-MM-dd"
        DefaultView="Months">
    </ajaxToolkit:CalendarExtender>
    <asp:Button ID="btnSearch" runat="server"  Width="60px" Text="查询" 
        onclick="btnSearch_Click" />&nbsp;<asp:Button ID="btnExport" runat="server" 
            Text="导出查询结果" onclick="btnExport_Click" />
        &nbsp;<asp:HyperLink ID="HyperLink1" runat="server" 
            NavigateUrl="~/Account/KQForm.aspx" Text="返回"></asp:HyperLink>
            <div style="margin-top:20px">
    <asp:GridView ID="gvKQExport" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="SerialNO" DataSourceID="sqlKQExport" 
        EmptyDataText="没有符合条件的数据" CellPadding="4" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="EmployeeName" HeaderText="姓名" 
                SortExpression="EmployeeName" />
            <asp:BoundField DataField="TypeName" HeaderText="请假类型" 
                SortExpression="TypeName" />
            <asp:BoundField DataField="StartDate" HeaderText="开始时间" 
                SortExpression="StartDate" DataFormatString="{0:D}" />
            <asp:BoundField DataField="EndDate" HeaderText="结束时间" 
                SortExpression="EndDate" DataFormatString="{0:D}" />
            <asp:BoundField DataField="DeptName" HeaderText="所在科室" 
                SortExpression="DeptName" />
            <asp:BoundField DataField="ExamerName" HeaderText="审批人" 
                SortExpression="ExamerName" />
            <asp:BoundField DataField="CheckerName" HeaderText="复核人" 
                SortExpression="CheckerName" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
            </div>
        <asp:SqlDataSource ID="sqlKQExport" runat="server" 
            ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>" 
            
            
            
            
            
            
            SelectCommand="SELECT TKQRequestRecord.FEmployeeID, TKQRequestRecord.StartDate, TKQRequestRecord.EndDate, TKQRequestRecord.TypeCode, TKQRequestRecord.Memo, TKQRequestRecord.ExamStatus, TKQRequestRecord.CheckStatus, TKQRequestRecord.SerialNO, TKQRequestRecord.ReadStatus, TKQRequestRecord.DeptCode, TEmployee_1.FName AS EmployeeName, TDictDept.FName AS DeptName, TDictKQType.FName AS TypeName, (SELECT FName FROM TEmployee WHERE (FEmployeeID = TKQRequestRecord.ExamerID)) AS ExamerName, (SELECT FName FROM TEmployee AS TEmployee_2 WHERE (FEmployeeID = TKQRequestRecord.CheckerID)) AS CheckerName FROM TKQRequestRecord INNER JOIN TEmployee AS TEmployee_1 ON TKQRequestRecord.FEmployeeID = TEmployee_1.FEmployeeID INNER JOIN TDictDept ON TKQRequestRecord.DeptCode = TDictDept.FDeptCode INNER JOIN TDictKQType ON TKQRequestRecord.TypeCode = TDictKQType.FKQTypeCode WHERE (TKQRequestRecord.CheckStatus = 1) AND (TKQRequestRecord.StartDate &gt;= @StartDate) AND (TKQRequestRecord.StartDate &lt;= @EndDate) AND (TKQRequestRecord.ExamStatus = 1) AND (TKQRequestRecord.DeptCode = @DeptCode) AND (TKQRequestRecord.TypeCode &lt;= '12') ORDER BY EmployeeName, DeptName, TKQRequestRecord.StartDate">
            <SelectParameters>
                <asp:Parameter Name="StartDate" />
                <asp:Parameter Name="EndDate" />
                <asp:Parameter Name="DeptCode" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
    
    </form>
</body>
</html>
